package com.netease.image.video;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

public class EvenlySpacedLayout extends ViewGroup
{
  private boolean a = true;
  private boolean b;

  public EvenlySpacedLayout(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
  }

  private void a(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    int i = getChildCount();
    int j = 0;
    int k = 0;
    int m = 0;
    if (j < i)
    {
      View localView2 = getChildAt(j);
      if (localView2.getVisibility() == 8);
      while (true)
      {
        j++;
        break;
        m += localView2.getMeasuredWidth();
        k++;
      }
    }
    int n = paramInt3 - paramInt1 - m;
    int i1;
    int i2;
    int i3;
    label102: int i4;
    label105: View localView1;
    if (this.b)
    {
      i1 = k + 1;
      i2 = n / i1;
      if (!this.b)
        break label145;
      i3 = i2;
      i4 = 0;
      if (i4 >= i)
        return;
      localView1 = getChildAt(i4);
      if (localView1.getVisibility() != 8)
        break label151;
    }
    while (true)
    {
      i4++;
      break label105;
      i1 = k - 1;
      break;
      label145: i3 = 0;
      break label102;
      label151: int i5 = localView1.getMeasuredWidth();
      int i6 = localView1.getMeasuredHeight();
      localView1.layout(i3, 0, i3 + i5, i6 + 0);
      i3 = i2 + (i3 + i5);
    }
  }

  private void b(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    int i = getChildCount();
    int j = 0;
    int k = 0;
    int m = 0;
    if (j < i)
    {
      View localView2 = getChildAt(j);
      if (localView2.getVisibility() == 8);
      while (true)
      {
        j++;
        break;
        m += localView2.getMeasuredHeight();
        k++;
      }
    }
    int n = paramInt4 - paramInt2 - m;
    int i1;
    int i2;
    int i3;
    label102: int i4;
    label105: View localView1;
    if (this.b)
    {
      i1 = k + 1;
      i2 = n / i1;
      if (!this.b)
        break label145;
      i3 = i2;
      i4 = 0;
      if (i4 >= i)
        return;
      localView1 = getChildAt(i4);
      if (localView1.getVisibility() != 8)
        break label151;
    }
    while (true)
    {
      i4++;
      break label105;
      i1 = k - 1;
      break;
      label145: i3 = 0;
      break label102;
      label151: int i5 = localView1.getMeasuredWidth();
      int i6 = localView1.getMeasuredHeight();
      localView1.layout(0, i3, i5 + 0, i3 + i6);
      i3 = i2 + (i3 + i6);
    }
  }

  protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    if (this.a)
      a(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
    while (true)
    {
      return;
      b(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
    }
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    int i = 0;
    int j = getChildCount();
    int k = 0;
    int m = 0;
    if (k < j)
    {
      View localView = getChildAt(k);
      if (localView.getVisibility() == 8);
      while (true)
      {
        k++;
        break;
        measureChild(localView, paramInt1, paramInt2);
        if (this.a)
        {
          m += localView.getMeasuredWidth();
          i = Math.max(i, localView.getMeasuredHeight());
          continue;
        }
        i += localView.getMeasuredHeight();
        m = Math.max(m, localView.getMeasuredWidth());
      }
    }
    setMeasuredDimension(resolveSize(m, paramInt1), resolveSize(i, paramInt2));
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.image.video.EvenlySpacedLayout
 * JD-Core Version:    0.6.0
 */